flat assembler
Message board for the users of flat assembler.
Index
> Main > Printing a Float number on the screen |
Author |
|
AlexP 08 Apr 2008, 21:12
Use a rounding function, I've recently used one in a high-level language course in school but I'm afraid I cannot provide it to you.
|
|||
08 Apr 2008, 21:12 |
|
sakeniwefu 09 Apr 2008, 00:37
Wait I realized I was stupid. Learn to do it in float.
OK. adding +-(5/10^precision+1) and reading it up to precision should round it arithmetically, but it doesn't look optimal. I just cannot find any web or source that will explain how to round floats without libraries or by hand. Or just round down. Last edited by sakeniwefu on 09 Apr 2008, 01:11; edited 3 times in total |
|||
09 Apr 2008, 00:37 |
|
edfed 09 Apr 2008, 00:42
you can also try to convert from the binary image of the floating point value with the needed decimals.
decode it and dispaly it without any FP instructions. it will free the FPU that is supposed to calculate other things at the same time. and better, it will be able to convert any FP in any format with only the general regisers. |
|||
09 Apr 2008, 00:42 |
|
AlexP 09 Apr 2008, 12:55
Sakeniwefu found my idea
|
|||
09 Apr 2008, 12:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.