Hi Josh,

Floating-point support does work, it just doesn't work the way you think it
does. The number 0.5 isn't a C-compatible float or double; it's an object.
So instead of writing

 (+ 0.5 0.5)

you should write

 [0.5 + 0.5]

The message-send expression above evaluates to a floating-point object... to
print it, you should write:

 [StdOut print: [0.5 + 0.5]]

Otherwise what you'll see is the address of that object in memory.

Now, even if floating-point numbers weren't objects, it still wouldn't make
sense to add them using (+ ...), because (+ ...) stands for native integer
addition, and floating-point addition is a different operation.

Cheers,
Alex

On 5/27/07, Joshua Gargus <[EMAIL PROTECTED]> wrote:

Hi,

I was dabbing a bit with jolt, and noticed that the floating-point
support is broken.

.(+ 0.5 0.5)
  => 272077144

I don't remember if Ian claimed that floating point actually worked
at some point, or if I misread SVN commit comments that were only
about partial steps towards floating point support.  Anyone?

Thanks,
Josh


_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

Reply via email to