Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: nemo on September 02, 2010, 09:17:59 pm

Title: Floating Point in Axe
Post by: nemo on September 02, 2010, 09:17:59 pm
so i was thinking about making my own "floating point data type" if you will. it'll probably be more of a tutorial on how one might manage floating point numbers if one wants. it would probably not use mantissa-exponent notation, as although it's very fast, it's expensive on memory. instead i was thinking of having a sign bit, then 12 bits for the integer part and 11 bits for the floating part. this would allow your maximum number to be 4095.2047. i know, it's small. i was thinking of having them be stored as four bytes, making the highest number 65535.32767, which i think is more reasonable since you get 4 digits in the floating point guaranteed, and a pretty high number as your integer part. this would allow for some basic floating point in axe. (quadratic solver anyone?) unless this is a feature quigibo plans to put in the final release and i'm just blabbing about floating point for nothing.
Title: Re: Floating Point in Axe
Post by: Raylin on September 02, 2010, 09:22:46 pm
Uhm...
Aren't there floating points in Axe now?
Title: Re: Floating Point in Axe
Post by: meishe91 on September 02, 2010, 09:23:01 pm
I think it'd be cool :) I've often wondered how to create floating points from none but never took the time to try and learn how.
Title: Re: Floating Point in Axe
Post by: calc84maniac on September 02, 2010, 09:24:51 pm
so i was thinking about making my own "floating point data type" if you will. it'll probably be more of a tutorial on how one might manage floating point numbers if one wants. it would probably not use mantissa-exponent notation, as although it's very fast, it's expensive on memory. instead i was thinking of having a sign bit, then 12 bits for the integer part and 11 bits for the floating part. this would allow your maximum number to be 4095.2047. i know, it's small. i was thinking of having them be stored as four bytes, making the highest number 65535.32767, which i think is more reasonable since you get 4 digits in the floating point guaranteed, and a pretty high number as your integer part. this would allow for some basic floating point in axe. (quadratic solver anyone?) unless this is a feature quigibo plans to put in the final release and i'm just blabbing about floating point for nothing.
That would actually be fixed-point (cause the decimal point is in a fixed position)
Title: Re: Floating Point in Axe
Post by: nemo on September 02, 2010, 09:28:21 pm
so i was thinking about making my own "floating point data type" if you will. it'll probably be more of a tutorial on how one might manage floating point numbers if one wants. it would probably not use mantissa-exponent notation, as although it's very fast, it's expensive on memory. instead i was thinking of having a sign bit, then 12 bits for the integer part and 11 bits for the floating part. this would allow your maximum number to be 4095.2047. i know, it's small. i was thinking of having them be stored as four bytes, making the highest number 65535.32767, which i think is more reasonable since you get 4 digits in the floating point guaranteed, and a pretty high number as your integer part. this would allow for some basic floating point in axe. (quadratic solver anyone?) unless this is a feature quigibo plans to put in the final release and i'm just blabbing about floating point for nothing.
That would actually be fixed-point (cause the decimal point is in a fixed position)

so i would have to use mantissa-exponent notation, or something similar for it to be floating point? is there an advantage to floating point?

raylin, i don't think there is. i mean there are 9 byte floats that are organized by the OS, but there's no way to multiply, add, subtract or divide them in an axe program. i'm just asking if attempting to make this sort of system is a good idea, and then have subroutines to add/subtract/multiply/divide.

i'm just wondering if it's worth the effort or if anyone would use them.
Title: Re: Floating Point in Axe
Post by: Quigibo on September 02, 2010, 10:30:52 pm
Well, there is already the 8.8 multiplication built in.  What might be more useful would be an extended precision math engine that uses 32-bit numbers instead of 16-bit (so 16.16).  That gives signed numbers as high as 32,768 with a precision of (1/2)^16 which is around 0.00001  Unfortunately, the drawback is that the numbers need to take up 4 bytes or 2 Axe variables each.

If you know the math, it's not very difficult to write since you can use the *^ and ** commands which were designed for this purpose.  You could alternatively try 24.8 or 8.24 notations for applications requiring larger numbers or higher precision.
Title: Re: Floating Point in Axe
Post by: DJ Omnimaga on September 02, 2010, 11:54:53 pm
I'm not too sure if I would use them, but they may make certain programs (such as 3D stuff and... erm... quadratic solvers) easier to create in Axe.

Would it be very slow, though?