Author Topic: Extending Floats/Supporting Doubles  (Read 2639 times)

Offline boobay

  • Acquaintance
  • *
  • Posts: 41
    • View Profile
Extending Floats/Supporting Doubles
« on: May 14, 2007, 09:17:50 AM »
Ok. Is there a way to extend FluffOS to support more than "0.000000"

We're needing support for double precision. How would I go about implementing this?

Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: Extending Floats/Supporting Doubles
« Reply #1 on: May 14, 2007, 09:26:55 AM »
It's a bit harder doing this correctly than doing the 64 bit ints unfortunately.

on 32 bit machines it would double the size of the union that contains the stored values.
making it 64 bit machines only would require an ifdef everywhere where we use float variables right now.

both are not good things, however! on a 64 bit machine you might just get away with adding -Dfloat=double to the compiler flags, I haven't tried this. When you do that it's likely that it won't print any extra digits but it should do the math with them at least.

Good luck!