XYZ
XYZ

Reputation: 27427

Is there unsigned Double in Swift?

Forgive me if this is a silly question, I a self-taught programmer. If there is unsigned Int for large whole number storage, there should be an unsigned Double for storing large floating point number like Double right?

Upvotes: 2

Views: 2689

Answers (2)

Ferruccio
Ferruccio

Reputation: 100718

According to the Swift Standard Library Reference, if a Double (aka Float64) does not give you enough precision, you can use a Float80. But I have to wonder what it is that are you trying to store that exceeds the capabilities of a Double.

Upvotes: 2

Christian
Christian

Reputation: 22343

It's because floating point formats, like Double is one, don't support unsigned numbers. Also just because you've got the possibility to use unsigned on some types like Int doesn't mean, that it has to work with others too.

Upvotes: 3

Related Questions