Thread overview | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 21, 2013 limits for numeric types | ||||
---|---|---|---|---|
| ||||
I feel kind of dumb asking this, as I thought I could solve it with 30 seconds on Google, but no luck. Where can I get values for min/max values for D numeric types, like what is available in limits.h and float.h for C/C++? My efforts have demonstrated that using a search engine for D related topics still has a way to go. Top results for the search "dlang limits numeric types" on Google. 1. Regulation D Wikipedia entry 2. Primitive Data Types (The Java Tutorials) - Oracle 3. Regulation D - Pacific Trust Bank 4. Numeric Type Overview - MySQL 5. Built-in-Types - Pyton 2.7.5 6. Regulation D Reserve Requirements (US Federal Reserve) 7. Hottest Numeric Limits Answers (Stack Overflow) 8. Regulation D - Tyndall Federal Credit Union 9. limits.conf() - Linux Man Page Googling "dlang numeric limits" does turn up a single D reference as #1 (a thread on this forum), but sadly not what I was looking for. |
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On Friday, 21 June 2013 at 19:19:37 UTC, Craig Dillabaugh wrote: > Where can I get values for min/max values for D numeric types, > like what is available in limits.h and float.h for C/C++? Literally type: int.max int.min long.max long.min etc etc etc. The one that's weird is float.min_normal I think. There's a list here: http://dlang.org/property.html |
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Friday, 21 June 2013 at 19:22:15 UTC, Adam D. Ruppe wrote:
> On Friday, 21 June 2013 at 19:19:37 UTC, Craig Dillabaugh wrote:
>> Where can I get values for min/max values for D numeric types,
>> like what is available in limits.h and float.h for C/C++?
>
> Literally type:
>
> int.max
> int.min
> long.max
> long.min
>
> etc etc etc. The one that's weird is float.min_normal I think.
>
> There's a list here:
>
> http://dlang.org/property.html
Thank you very much.
Now, is there any way to get Google to find my question/your
answer if someone searches for "dlang numeric limits"?
Cheers,
Craig
|
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | Adam D. Ruppe: > etc etc etc. The one that's weird is float.min_normal I think. Don't use float.min/double.min/real.min. I have opened a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=10439 Bye, bearophile |
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
> Now, is there any way to get Google to find my question/your
> answer if someone searches for "dlang numeric limits"?
Beats me :(
|
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On Fri, Jun 21, 2013 at 09:19:36PM +0200, Craig Dillabaugh wrote: > I feel kind of dumb asking this, as I thought I could solve it with 30 seconds on Google, but no luck. > > Where can I get values for min/max values for D numeric types, like what is available in limits.h and float.h for C/C++? [...] Take a look at this: http://dlang.org/property.html D type names have built-in properties: int.max, real.max, float.max, etc.. No need to resort to an external file to define all these, since the compiler already knows them in the first place! T -- Debian GNU/Linux: Cray on your desktop. |
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Friday, 21 June 2013 at 19:39:06 UTC, Adam D. Ruppe wrote:
> On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
>> Now, is there any way to get Google to find my question/your
>> answer if someone searches for "dlang numeric limits"?
>
> Beats me :(
Oddly enough, using Bing or Yahoo (same engine maybe?) return
better results than Google. I guess I need to ween myself off my
Google dependency.
|
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On 06/21/2013 12:19 PM, Craig Dillabaugh wrote: > I feel kind of dumb asking this, as I thought I could solve it > with 30 seconds on Google, but no luck. > > Where can I get values for min/max values for D numeric types, > like what is available in limits.h and float.h for C/C++? I have the following chapters, especially the first one is decidedly brief: http://ddili.org/ders/d.en/types.html http://ddili.org/ders/d.en/floating_point.html No, I could not come up with search terms that would find them. :( Ali |
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Craig Dillabaugh | On Friday, 21 June 2013 at 19:51:16 UTC, Craig Dillabaugh wrote:
> I guess I need to ween myself off my Google dependency.
Good idea! I became a Bing guy a couple years ago and only go to google for those rare times when the bing results just suck. I find bing to be a much faster website too. (which is weird, they do these fancy backgrounds that you'd think would make it slow, but the actual search box works before the bg is loaded so it doesn't matter)
|
June 21, 2013 Re: limits for numeric types | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Friday, 21 June 2013 at 21:11:42 UTC, Adam D. Ruppe wrote:
> On Friday, 21 June 2013 at 19:51:16 UTC, Craig Dillabaugh wrote:
>> I guess I need to ween myself off my Google dependency.
>
> Good idea! I became a Bing guy a couple years ago and only go to google for those rare times when the bing results just suck. I find bing to be a much faster website too. (which is weird, they do these fancy backgrounds that you'd think would make it slow, but the actual search box works before the bg is loaded so it doesn't matter)
I am going to feel dirty using a Microsoft site, but I will just
have to get used to it!
I travel to China frequently and half the time Google is
completely useless there (oddly enough at other times it works
perfectly). The problem with Bing in China is that tends to
return only Chinese results to my English searches.
Interestingly, Yahoo seems to work the best in China (for English
language searches at least).
I usually use the integrated search feature in my browser, so I
usually don't have to worry about the fancy backgrounds.
|
Copyright © 1999-2021 by the D Language Foundation