[gambit-list] Are flonums passed around within Gambit by value or reference? What's their bit width on 32 & 64bir archs?

Bradley Lucier lucier at math.purdue.edu
Tue Nov 13 11:10:17 EST 2012


On 11/13/2012 11:01 AM, Mikael wrote:
> Dear Marc,
>
> Something I was curious about for long:
>
> So fixnums are passed around in Gambit by value and all objects like 
> closures, pairs, vectors and bignums are passed around by reference.

The objects that are boxed are listed in gambit.h:

  * ___sVECTOR       = tag for vectors
  * ___sPAIR         = tag for pairs
  * ___sRATNUM       = tag for ratnums
  * ___sCPXNUM       = tag for cpxnums
  * ___sSTRUCTURE    = tag for structures
  * ___sBOXVALUES    = tag for box and multiple-values objects
  * ___sMEROON       = tag for Meroon objects
  * ___sJAZZ         = tag for Jazz objects
  * ___sSYMBOL       = tag for symbols
  * ___sKEYWORD      = tag for keywords
  * ___sFRAME        = tag for continuation frames
  * ___sCONTINUATION = tag for continuations
  * ___sPROMISE      = tag for promises
  * ___sWEAK         = tag for weak objects (wills and GC hash tables)
  * ___sPROCEDURE    = tag for procedures
  * ___sRETURN       = tag for returns
  * ___sFOREIGN      = tag for foreign data
  * ___sSTRING       = tag for strings
  * ___sS8VECTOR     = tag for 8-bit signed integer vectors
  * ___sU8VECTOR     = tag for 8-bit unsigned integer vectors
  * ___sS16VECTOR    = tag for 16-bit signed integer vectors
  * ___sU16VECTOR    = tag for 16-bit unsigned integer vectors
  * ___sS32VECTOR    = tag for 32-bit signed integer vectors
  * ___sU32VECTOR    = tag for 32-bit unsigned integer vectors
  * ___sF32VECTOR    = tag for 32-bit floating point number vectors
  * ___sS64VECTOR    = tag for 64-bit signed integer vectors
  * ___sU64VECTOR    = tag for 64-bit unsigned integer vectors
  * ___sF64VECTOR    = tag for 64-bit floating point number vectors
  * ___sFLONUM       = tag for flonums
  * ___sBIGNUM       = tag for bignums


>
> What about flonums?
>
>
> Also, what's the flonum bit width (exponent & fraction respectively) 
> on 32 and 64bit architecture

32-bit and 64-bit architectures both use 64-bit IEEE arithmetic. (At 
least, on an architecture where this doesn't happen, some things will be 
computed incorrectly.) That's binary64 in the following table:

https://en.wikipedia.org/wiki/IEEE_floating_point#Basic_formats

>
> Thanks,
> Mikael
>
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list




More information about the Gambit-list mailing list