◐ Shell
clean mode source ↗

Floating-point environment - cppreference.com

De cppreference.com

<metanoindex/>

O ambiente de ponto flutuante é o conjunto de bandeiras de ponto flutuante de estado e modos de controle suportados pela implementação. É local de segmento, cada segmento herda o estado inicial do seu ambiente de ponto flutuante do segmento pai. Operações de ponto flutuante modificar as bandeiras de ponto flutuante de status para indicar os resultados anormais ou informações auxiliar. O estado de modos de ponto flutuante de controle afeta os resultados de algumas operações de ponto flutuante.

Original:

The floating-point environment is the set of floating-point status flags and control modes supported by the implementation. It is thread-local, each thread inherits the initial state of its floating-point environment from the parent thread. Floating-point operations modify the floating-point status flags to indicate abnormal results or auxiliary information. The state of floating-point control modes affects the outcomes of some floating-point operations.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

O acesso ambiente de ponto flutuante e modificação só é significativo quando

#pragma STDC FENV_ACCESS

está definido para ON. Caso contrário, a execução é livre para assumir que os modos de controle de ponto flutuante são sempre as padrão e que as bandeiras de ponto flutuante de status nunca são testados ou modificado. Na prática, alguns compiladores atuais suportam a #pragma explicitamente, mas a maioria dos compiladores permitem acesso significativo ao ambiente de ponto flutuante de qualquer forma.

Original:

The floating-point environment access and modification is only meaningful when

#pragma STDC FENV_ACCESS

is set to ON. Otherwise the implementation is free to assume that floating-point control modes are always the default ones and that floating-point status flags are never tested or modified. In practice, few current compilers support the #pragma explicitly, but most compilers allow meaningful access to the floating-point environment anyway.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Tipos

Defined in header <cfenv>

fenv_t

O tipo que representa o ambiente de ponto flutuante inteiro

Original:

The type representing the entire floating-point environment

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

fexcept_t

O tipo que representa todas as bandeiras de ponto flutuante de status coletivamente

Original:

The type representing all floating-point status flags collectively

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Funções

limpa os especificados bandeiras de ponto flutuante de status

Original:

clears the specified floating-point status flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

determina qual dos especificados bandeiras de ponto flutuante de estado são definidas

Original:

determines which of the specified floating-point status flags are set

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

levanta as especificadas exceções de ponto flutuante

Original:

raises the specified floating-point exceptions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

copia o estado dos especificados bandeiras de ponto flutuante de status de ou para o ambiente de ponto flutuante

Original:

copies the state of the specified floating-point status flags from or to the floating-point environment

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

(C++11)
(C++11)

obtém ou define direção arredondamento

Original:

gets or sets rounding direction

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

salva ou restaura o ambiente actual ponto flutuante

Original:

saves or restores the current floating point environment

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

poupa o meio ambiente, limpa todos os sinalizadores de status e ignora todos os erros futuros

Original:

saves the environment, clears all status flags and ignores all future errors

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

restaura o ambiente de ponto flutuante e levanta a anteriormente levantar exceções

Original:

restores the floating-point environment and raises the previously raise exceptions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função) [edit]

Macros

exceções de ponto flutuante

Original:

floating-point exceptions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(macro constante) [edit]

de ponto flutuante direção arredondamento

Original:

floating-point rounding direction

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(macro constante) [edit]

ambiente padrão de ponto flutuante

Original:

default floating-point environment

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(macro constante) [edit]

Notas

As exceções de ponto flutuante não estão relacionados com as exceções C + +. Quando uma operação de ponto flutuante gera uma exceção de ponto flutuante, o estado das mudanças de ponto flutuante de ambiente, que podem ser testadas com std::fetestexcept, mas a execução de um programa C + + na maioria das implementações continua ininterruptamente.

Original:

The floating-point exceptions are not related to the C++ exceptions. When a floating-point operation raises a floating-point exception, the status of the floating-point environment changes, which can be tested with std::fetestexcept, but the execution of a C++ program on most implementations continues uninterrupted.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Há extensões de compilador que podem ser usados ​​para gerar exceções C + + automaticamente sempre que uma exceção de ponto flutuante é levantada:

Original:

There are compiler extensions that may be used to generate C++ exceptions automatically whenever a floating-point exception is raised:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

  • GNU libc feenableexcept() função permite captura das exceções de ponto flutuante, o que gera a SIGFPE sinal. Se o -fnon-call-exceptions opção de compilador foi usado, o manipulador para que o sinal pode lançar um definido pelo usuário exceção C + +.

    Original:

    GNU libc function feenableexcept() enables trapping of the floating-point exceptions, which generates the signal SIGFPE. If the compiler option -fnon-call-exceptions was used, the handler for that signal may throw a user-defined C++ exception.

    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

  • Microsoft _control87() função WinAPI permite captura das exceções de ponto flutuante, o que gera uma exceção de hardware, o que pode ser convertido para exceções C + + com _set_se_translator.

    Original:

    Microsoft WinAPI function _control87() enables trapping of the floating-point exceptions, which generates a hardware exception, which can be converted to C++ exceptions with _set_se_translator.

    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.