Results 1 to 6 of 6

Thread: How can I use the "float_round_style" enum in C++

  1. #1
    Join Date
    Dec 2009
    Posts
    22

    How can I use the "float_round_style" enum in C++

    Hi, I had learned the C++ language in the IT subject of the First Year Of Junior college of the Commerce. I also had the knowledge of the Enumeration in C++ language. I can not know about the float_round_style enum in the C++ language. So, I want to know about the float_round_style enum in C++ language. If anyone has the knowledge of the float_round_style enum then reply me.
    Last edited by Garett; 13-02-2010 at 07:12 PM.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    float_round_style

    According to my knowledge about the float_round_style is that, The float_round_style can be used to defined the Enumerated type for floating types with possible rounding styles. The float_round_style can be the member of the round_style in the numeric_class class template. I hope you should understand. If you can not understand then reply me.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    How can I use the "float_round_style"

    The float_round_style can be defined in the following manner in the C++ language :
    Code:
    enum float_round_style 
    {
      round_indeterminate       = -1,
      round_to_nearest          = 1,
      round_toward_zero         = 0,
      round_toward_neg_infinity = 3
      round_toward_infinity     = 2,
    };

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    How can I use the "float_round_style" enum in C++

    The float_round_style can be declared as the static const float_round_style. The float_round_style can be used for the rounding style for the type. The float_round_style can be use for the specialization values. The Specializations of the float_round_style for integer types can returns the round_toward_zero. The float_round_style can be useful for all the types of floating point.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How can I use the "float_round_style" enum in C++

    The several methods that can an implementation can be choose for rounding values of the floating-point into a value an integer, can be described by the Enumeration. The enumeration can describes the following :
    1. round_toward_neg_infinity — round to more negative integer
    2. round_toward_zero — round toward zero
    3. round_indeterminate — rounding method cannot be determined
    4. round_toward_infinity — round away from zero
    5. round_to_nearest — round to nearest integer

  6. #6
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How can I use the "float_round_style" enum in C++

    PROGRAM :
    Code:
    #ifndef _LIMITS_
    #define _LIMITS_
    #include <cfloat>
    #include <climit>
    extern "C++"
    {
    enum float_round_style 
    {
        round_toward_zero		= 0,
        round_indeterminate		= -1,
        round_toward_beg_infinity	= 3
        round_toward_infinity	= 2,
        round_to_nearest		= 1,
        };
    }

Similar Threads

  1. Replies: 3
    Last Post: 10-01-2014, 10:40 AM
  2. Replies: 6
    Last Post: 18-05-2010, 12:27 AM
  3. Which java enum should I give to the variable "followers"?
    By KADRI in forum Software Development
    Replies: 4
    Last Post: 20-02-2010, 06:24 PM
  4. Replies: 3
    Last Post: 25-06-2009, 03:49 AM
  5. Replies: 1
    Last Post: 06-11-2007, 02:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,884,843.20083 seconds with 17 queries