473,690 Members | 3,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ


how do i set a floating point to the maximum float value in c++?

Feb 28 '06 #1
2 9524
bo*@coolgroups. com wrote:
how do i set a floating point to the maximum float value in c++?

float value = std::numeric_li mits<float>::ma x();

Please remove capital As from my address when replying by mail
Feb 28 '06 #2
nice. thanks.

Feb 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Pat | last post by:
Give two double-typed variable X and Y. If (X==Y) is true, then how about the following results: (float(X) > float(Y))? (float(X) < float(Y))? (float(X) >= float(Y))? ( X > float(Y) )? ( X < float(Y) )?
by: Glen Able | last post by:
Should it be possible to create a custom class, 'Float', which would behave as a drop-in replacement for the builtin float type? As mentioned in another thread, I once tried this in rather a hurry to try and catch some floating point naughtiness, but was stumped in various places. Is there a fundamental obstacle to doing this? thanks, G.A.
by: Gerald Lafreniere | last post by:
{ float F=123.456000; F*=1000; // Actually I used a for loop F*=10 three times. printf("%f\n", F); } This will produce something like 123456.00XXXX, where XXXX are garbage digits. Why is this happening, and how do I get rid of it? (using Dev-C++
by: Dave win | last post by:
Hi all: I'm confused with the expression "(float *())". Book says that this is a cast. But, I have no idea of this expr. why could this expr ignore the variable??? Thanx!!!
by: Sisyphus | last post by:
Hi, I have some software that does the following (in an attempt to determine whether the double x, can be represented just as accurately by a float): void test_it(double x) { float y = x; if(x == y) { printf("x can be represented precisely by a float\n"); }
by: Marc Pelletier | last post by:
Hello, I am having trouble implementing the following callback: CNCSError CECWCompressor::WriteReadLine(UINT32 nNextLine, void **ppInputArray) where ppInputArray is a 3 by x array. The length of x is not known at compile time.
by: ehabaziz2001 | last post by:
That program does not yield and respond correctly espcially for the pointers (*f),(*i) in print_divide_meter_into(&meter,&yds,&ft,&ins); /*--------------pnt02own.c------------ ---1 inch = 2.51 cm ---1 inch = 2.54/100 Meter ---1 yard = 3 feet ---1 feet = 12 inch
by: vjnr83 | last post by:
Hi, I have a doubt: what is the difference between float **p and float *p? Thanks in advance, Vijay
by: Shirsoft | last post by:
I have a 32 bit intel and 64 bit AMD machine. There is a rounding error in the 8th digit. Unfortunately because of the algorithm we use, the errors percolate into higher digits. C++ code is ------------------ b += (float)(mode *val); On 32 bit(intel , vs 2003, C++), some watch variables are
by: Arnie | last post by:
Folks, We ran into a pretty significant performance penalty when casting floats. We've identified a code workaround that we wanted to pass along but also was wondering if others had experience with this and if there is a better solution. -jeff
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.