www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - limits for numeric types

reply "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
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

for.
Jun 21 2013
next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Jun 21 2013
next sibling parent reply "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
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
Jun 21 2013
next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
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 :(
Jun 21 2013
parent reply "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
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.
Jun 21 2013
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
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)
Jun 21 2013
parent "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
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.
Jun 21 2013
prev sibling parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
 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
Yes, get the text, "numeric limits" onto the page. Though, "dlang max int" seems to work just fine.
Jun 21 2013
parent reply "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
On Saturday, 22 June 2013 at 02:47:04 UTC, Jesse Phillips wrote:
 On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
 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
Yes, get the text, "numeric limits" onto the page.
Could you expand on this part a bit. Is there a way to tell the Google search engine, hey I searched for this, you gave me these links, but here is the one I wanted.
Jun 22 2013
parent "Craig Dillabaugh" <cdillaba cg.scs.carleton.ca> writes:
On Saturday, 22 June 2013 at 11:20:18 UTC, Craig Dillabaugh wrote:
 On Saturday, 22 June 2013 at 02:47:04 UTC, Jesse Phillips wrote:
 On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh 
 wrote:
 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
Yes, get the text, "numeric limits" onto the page.
Could you expand on this part a bit. Is there a way to tell the Google search engine, hey I searched for this, you gave me these links, but here is the one I wanted.
Sorry, replied too early in the morning. Now I understand what you are saying, to add numeric limits to the D site. I may give that a try.
Jun 22 2013
prev sibling parent "bearophile" <bearophileHUGS lycos.com> writes:
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
Jun 21 2013
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
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.
Jun 21 2013
prev sibling parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
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
Jun 21 2013