News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

print floating point stuff with 'printf"?

Started by deeR44, April 28, 2022, 04:36:00 PM

Previous topic - Next topic

deeR44

Just starting to do floating point stuff. Where do I find printf stuff for that?

What's the difference between "printf" and "crt_printf"?

jj2007

Quote from: deeR44 on April 28, 2022, 04:36:00 PM
Just starting to do floating point stuff. Where do I find printf stuff for that?

On the web, all over the place

QuoteWhat's the difference between "printf" and "crt_printf"?

printf(...) is a macro
invoke crt_printf, ... behaves identically

deeR44

QuoteOn the web, all over the place

Well then, I'll keep looking.

hutch--

The C function "printf" is part of the C runtime library and as such, the reference you are looking for is with C documentation from a variety of sources, Microsoft, universities and online publications etc ....

It is by no means the only choice for displaying floating point to a console but as you have made that choice to use "printf", its C documentation you are looking for.

deeR44

Quoteyou have made that choice to use "printf", its C documentation you are looking for.
Thank you, Hutch.

avcaballero

Writing a float number without using external libs, masm, fasm and nasm version

http://abreojosensamblador.epizy.com/?Tarea=1&SubTarea=20&Lang=1#EscribeFloat

jj2007

Quote from: caballero on April 29, 2022, 05:35:54 PM
Writing a float number without using external libs, masm, fasm and nasm version

http://abreojosensamblador.epizy.com/?Tarea=1&SubTarea=20&Lang=1#EscribeFloat

Looks good but is a bit difficult to find, therefore I attach your source :thumbsup:

jack

is that your site caballero?
I attempted to write my own multi-precision floating-point math routines in FreeBasic and some of the more painfully difficult routines to implement were the conversion functions
it's easy if the number base is a power of 10 but it's a different story if the number base is a power of 2
what I wound up doing is to multiply or divide the mp-float by powers of 10 until you can start extracting decimal digits, it's rather slow but I am not motivated to pursue this any further

avcaballero

> is that your site caballero?

Yes, it is. I made it on my own with php, including the forum, an example of using linked lists.

jack

I like your site, I think it's well done  :smiley:

avcaballero


Gunther

Caballero,

your site is well done and the content is also good.
You have to know the facts before you can distort them.


NoCforMe

Is there a Win32 function that'll format floating-point values? I use wsprintf() all the time*, but it only handles integer values.

When I need printable representations of FP values, I use Raymond's library (specifically, FpFLtoA() ).

* I probably shouldn't be using this function, as it's not "safe" (can be used to hack code via buffer overruns), but since I'm not creating "production" code that anyone else is gonna use, it's not much of a problem ...
Assembly language programming should be fun. That's why I do it.

Greenhorn

You may have a look at StringCchPrintf or one of the function that it replaces.
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.