Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
problème avec std::numeric_limits<long double>::infinity()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marc Guéguen  
View profile   Translate to Translated (View Original)
 More options Nov 8 2012, 8:42 am
Newsgroups: fr.comp.lang.c++
From: Marc Guéguen <mgueg...@metrica.fr>
Date: Thu, 8 Nov 2012 14:42:24 +0100
Local: Thurs, Nov 8 2012 8:42 am
Subject: problème avec std::numeric_limits<long double>::infinity()
Bonjour,
J'utilise une classe d riv e de std::numpunct pour le formatage des nombres,
d finie comme suit (en simplifi pour aller l'essentiel)

class owner_defined_facet : public std::numpunct<char> {
    virtual std::string do_grouping() const    { return "\03"; }
    virtual char do_thousands_sep() const     { return ' ';}
    virtual char do_decimal_point() const     { return ',';}

};

Ensuite, je fais
  std::locale the_one(std::locale(),owner_defined_facet());
  std::basic_ostringstream<char> *ossPtr=new std::basic_ostringstream<char>;
  ossPtr->imbue( the_one);
 // et pour crire dans le flux le nombre d
  ossPtr->operator<<(d);
 // avec ceci pour r cup rer la valeur
 ossPtr->str();

Mon probl me, a plante avec std::numeric_limits<long double>::infinity()
comme valeur de d
Et a fonctionne si je supprime le s parateur des milliers comme ceci
virtual std::string do_grouping() const    { return "\0"; }

Est-ce que vous voyez o est le probl me ?

Une autre question : comment un nombre se voit affecter la valeur
std::numeric_limits<long double>::infinity(),
si ce n'est pas par affectation directe ?

Merci bien.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Guéguen  
View profile   Translate to Translated (View Original)
 More options Nov 8 2012, 10:12 am
Newsgroups: fr.comp.lang.c++
From: Marc Guéguen <mgueg...@metrica.fr>
Date: Thu, 8 Nov 2012 16:12:34 +0100
Local: Thurs, Nov 8 2012 10:12 am
Subject: Re: problème avec std::numeric_limits<long double>::infinity()
Précision :
J'obtiens en fait la sortie suivante
+IN F00 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000....
avec encore plein de zéros !

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Olivier Miakinen  
View profile   Translate to Translated (View Original)
 More options Nov 8 2012, 6:17 pm
Newsgroups: fr.comp.lang.c++
From: Olivier Miakinen <om+n...@miakinen.net>
Date: Fri, 09 Nov 2012 00:19:00 +0100
Subject: Re: problème avec std::numeric_limits<long double>::infinity()
Bonjour,

Le 08/11/2012 14:42, Marc Guéguen a écrit :

> Une autre question : comment un nombre se voit affecter la valeur
> std::numeric_limits<long double>::infinity(),
> si ce n'est pas par affectation directe ?

Est-ce que « long double valeur = 1.L/0.L; », c'est ce que tu appelles
une affectation directe ?

Si oui, il y a :
  long double valeur = 1.L;
  valeur /= 0.L;

Mais tu peux aussi multiplier std::numeric_limits<long double>::max()
par lui-même.

Enfin... j'espère ne pas être à côté de la plaque car je n'ai jamais
utilisé tout ça.

Cordialement,
--
Olivier Miakinen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Guéguen  
View profile   Translate to Translated (View Original)
 More options Nov 9 2012, 7:51 am
Newsgroups: fr.comp.lang.c++
From: Marc Guéguen <mgueg...@metrica.fr>
Date: Fri, 9 Nov 2012 13:50:59 +0100
Local: Fri, Nov 9 2012 7:50 am
Subject: Re: problème avec std::numeric_limits<long double>::infinity()
Je te remercie pour ta réponse.
Reste le problème du formatage...

"Olivier Miakinen" <om+n...@miakinen.net> a écrit dans le message de
news:k7heio$88h$1@cabale.usenet-fr.net...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Olivier Miakinen  
View profile   Translate to Translated (View Original)
 More options Nov 9 2012, 10:40 am
Newsgroups: fr.comp.lang.c++
From: Olivier Miakinen <om+n...@miakinen.net>
Date: Fri, 09 Nov 2012 16:40:08 +0100
Local: Fri, Nov 9 2012 10:40 am
Subject: Re: problème avec std::numeric_limits<long double>::infinity()
Bonjour,

Le 09/11/2012 13:50, Marc Guéguen a écrit :

> Je te remercie pour ta réponse.
> Reste le problème du formatage...

> "Olivier Miakinen" <om+n...@miakinen.net> a écrit dans le message de
> news:k7heio$88h$1@cabale.usenet-fr.net...
>> [copie intégrale, signature comprise]

Concernant le formatage de la valeur infinie avec std::numpunct, je n'ai
pas la réponse. Mais pour ce qui est du formatage des réponses dans les
news, voici la doc à lire :
<http://www.usenet-fr.net/fur/usenet/repondre-sur-usenet.html>.

Cordialement,
--
Olivier Miakinen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »