简体   繁体   中英

How to make float behave as double?

Is there some compiler flag in gcc to consider floats as doubles ? I tried

#define float double

but it creates havoc in many headers and compilation fails stating

ublic/sdk/inc/crt/float.h:5:40: fatal error: ../include/double.h: No such file or directory
At that line it was including float

I then tried doing

  typedef float double;

but it fails saying

 error: multiple types in one declaration

I am looking at some compiler flag which can do this for me.

There is no such thing. That's why you use different types. What you could do is replace " float " by " double " in your source code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM