+ 3

Irrational numbers in c++

Hello, I am a beginner with the C++ programming language and the only data types I really know are int , float, double, and bool. From what I managed to understand, however, is that these data types deal only with rational numbers. I was wondering if anyone knew how to utilize irrational numbers in C++? I’d appreciate any help :)

4th Jul 2019, 3:11 PM
Cathrine
Cathrine  - avatar
2 odpowiedzi
+ 3
I think you're mistaken, int is used to store integer number, boolean is only true or false (not really a number, more like a state), float and double are used to store fractional number whether it's rational or not, so you can use those to deal with irrational number
4th Jul 2019, 3:36 PM
Agent_I
Agent_I - avatar
+ 3
ok thank you. i’ll try that
4th Jul 2019, 3:50 PM
Cathrine
Cathrine  - avatar