0 Members and 1 Guest are viewing this topic.
Quote from: jacobly on November 27, 2011, 07:51:50 pmQuote from: Freyaday on November 27, 2011, 07:49:59 pmQuote from: jacobly on November 27, 2011, 06:17:58 pmQuote from: Freyaday on November 27, 2011, 12:43:57 amPerhaps a floating-point-math Axiom, with a function to store a float to an axevar?How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0By how you want it truncated, I mean what do you want it truncated to.Truncation is a mathematical function. You truncate to a number. To put it in BASIC, iPart()
Quote from: Freyaday on November 27, 2011, 07:49:59 pmQuote from: jacobly on November 27, 2011, 06:17:58 pmQuote from: Freyaday on November 27, 2011, 12:43:57 amPerhaps a floating-point-math Axiom, with a function to store a float to an axevar?How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0By how you want it truncated, I mean what do you want it truncated to.
Quote from: jacobly on November 27, 2011, 06:17:58 pmQuote from: Freyaday on November 27, 2011, 12:43:57 amPerhaps a floating-point-math Axiom, with a function to store a float to an axevar?How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.There is only one kind of truncation. It's where you chop off the decimal portion. Or, to put it another way, round towards 0
Quote from: Freyaday on November 27, 2011, 12:43:57 amPerhaps a floating-point-math Axiom, with a function to store a float to an axevar?How can a float fit in a single axe var? Unless you want truncation, but then you would have to specify how you want it truncated.
Perhaps a floating-point-math Axiom, with a function to store a float to an axevar?
http://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.
In other news, Frey continues kicking unprecedented levels of ass.
Ahhhh i see, i thought you wanted an Axiom to use the 2 bytes in each AxeVar as floating point data, so we could have native FP in Axe If all you want to do is convert TiOS Floating Point variables into Axe variable (while truncating all the decimal points) you can use the already build in float{} command
Quote from: Builderboy on November 27, 2011, 07:54:28 pmhttp://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.
Quote from: Freyaday on November 27, 2011, 07:56:09 pmQuote from: Builderboy on November 27, 2011, 07:54:28 pmhttp://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.But what do you want me to do with a floating-point number like 100000?
Quote from: jacobly on November 27, 2011, 08:02:05 pmQuote from: Freyaday on November 27, 2011, 07:56:09 pmQuote from: Builderboy on November 27, 2011, 07:54:28 pmhttp://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.But what do you want me to do with a floating-point number like 100000?Wrap around, so it'd be mod 65536
Quote from: Freyaday on November 27, 2011, 08:02:32 pmQuote from: jacobly on November 27, 2011, 08:02:05 pmQuote from: Freyaday on November 27, 2011, 07:56:09 pmQuote from: Builderboy on November 27, 2011, 07:54:28 pmhttp://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.But what do you want me to do with a floating-point number like 100000?Wrap around, so it'd be mod 65536Going by that, I would assume that you want unsigned integers... but what if the floating-point number is negative?
Quote from: jacobly on November 27, 2011, 08:14:18 pmQuote from: Freyaday on November 27, 2011, 08:02:32 pmQuote from: jacobly on November 27, 2011, 08:02:05 pmQuote from: Freyaday on November 27, 2011, 07:56:09 pmQuote from: Builderboy on November 27, 2011, 07:54:28 pmhttp://en.wikipedia.org/wiki/Truncation limits the number of digits to the right of the decimal point to a certain number. I believe he is asking how many digits you want to truncate to.16-bit integer would be the easiest to deal with and program (methinks.) Besides, if I want 8.8, I can multiply the float by 256 before converting it.But what do you want me to do with a floating-point number like 100000?Wrap around, so it'd be mod 65536Going by that, I would assume that you want unsigned integers... but what if the floating-point number is negative?represent it as it would be if it were a negative two's complement 16-bit integer.