How to set double precision in C ++ on MacOSX?

I am trying to execute port _controlfp (_CW_DEFAULT, 0xffffffff); from WIN32 to Mac OS X / Intel. I absolutely do not know how to transfer this instruction ... And you? Thank!

+3
source share
2 answers

Try Section 8.6 of the Gough Introduction to GCC , which demonstrates the x86 FLDCW instruction. But it helps if you tell us why you need it - if you want your doubles to be IEEE-754 64-bit doubles, the easiest way is to compile with -msse -mfpmath = sse.

+5
source

What precision elements do you control?

- Microsoft:

_control87 . , . , _control87. 0, _control87 . , : , ( 1) , . , fpcntrl = ((fpcntrl & ~mask) | (new & mask)), fpcntrl - .

"library". Microsoft, Mac.

:

  • Mac
  • Microsoft Mac
  • .

, , - , , . , , / . , . , .

.

+1

Source: https://habr.com/ru/post/1746919/


All Articles