Главная » Просмотр файлов » Стандарт языка Си С99 TC

Стандарт языка Си С99 TC (1113411), страница 45

Файл №1113411 Стандарт языка Си С99 TC (Стандарт языка Си С99 + TC) 45 страницаСтандарт языка Си С99 TC (1113411) страница 452019-04-24СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 45)

A range error may occur.Returns3The fma functions return (x × y) + z, rounded as one ternary operation.213) NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then thefmax functions choose the numeric value. See F.9.9.2.214) The fmin functions are analogous to the fmax functions in their treatment of NaNs.§7.12.13.1Library239ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.12.14 Comparison macros1The relational and equality operators support the usual mathematical relationshipsbetween numeric values. For any ordered pair of numeric values exactly one of therelationships — less, greater, and equal — is true. Relational operators may raise the‘‘invalid’’ floating-point exception when argument values are NaNs.

For a NaN and anumeric value, or for two NaNs, just the unordered relationship is true.215) The followingsubclauses provide macros that are quiet (non floating-point exception raising) versionsof the relational operators, and other comparison macros that facilitate writing efficientcode that accounts for NaNs without suffering the ‘‘invalid’’ floating-point exception. Inthe synopses in this subclause, real-floating indicates that the argument shall be anexpression of real floating type.7.12.14.1 The isgreater macroSynopsis1#include <math.h>int isgreater(real-floating x, real-floating y);Description2The isgreater macro determines whether its first argument is greater than its secondargument.

The value of isgreater(x, y) is always equal to (x) > (y); however,unlike (x) > (y), isgreater(x, y) does not raise the ‘‘invalid’’ floating-pointexception when x and y are unordered.Returns3The isgreater macro returns the value of (x) > (y).7.12.14.2 The isgreaterequal macroSynopsis1#include <math.h>int isgreaterequal(real-floating x, real-floating y);Description2The isgreaterequal macro determines whether its first argument is greater than orequal to its second argument. The value of isgreaterequal(x, y) is always equalto (x) >= (y); however, unlike (x) >= (y), isgreaterequal(x, y) doesnot raise the ‘‘invalid’’ floating-point exception when x and y are unordered.215) IEC 60559 requires that the built-in relational operators raise the ‘‘invalid’’ floating-point exception ifthe operands compare unordered, as an error indicator for programs written without consideration ofNaNs; the result in these cases is false.240Library§7.12.14.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Returns3The isgreaterequal macro returns the value of (x) >= (y).7.12.14.3 The isless macroSynopsis1#include <math.h>int isless(real-floating x, real-floating y);Description2The isless macro determines whether its first argument is less than its secondargument.

The value of isless(x, y) is always equal to (x) < (y); however,unlike (x) < (y), isless(x, y) does not raise the ‘‘invalid’’ floating-pointexception when x and y are unordered.Returns3The isless macro returns the value of (x) < (y).7.12.14.4 The islessequal macroSynopsis1#include <math.h>int islessequal(real-floating x, real-floating y);Description2The islessequal macro determines whether its first argument is less than or equal toits second argument. The value of islessequal(x, y) is always equal to(x) <= (y); however, unlike (x) <= (y), islessequal(x, y) does not raisethe ‘‘invalid’’ floating-point exception when x and y are unordered.Returns3The islessequal macro returns the value of (x) <= (y).7.12.14.5 The islessgreater macroSynopsis1#include <math.h>int islessgreater(real-floating x, real-floating y);Description2The islessgreater macro determines whether its first argument is less than orgreater than its second argument.

The islessgreater(x, y) macro is similar to(x) < (y) || (x) > (y); however, islessgreater(x, y) does not raisethe ‘‘invalid’’ floating-point exception when x and y are unordered (nor does it evaluate xand y twice).§7.12.14.5Library241ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Returns3The islessgreater macro returns the value of (x) < (y) || (x) > (y).7.12.14.6 The isunordered macroSynopsis1#include <math.h>int isunordered(real-floating x, real-floating y);Description2The isunordered macro determines whether its arguments are unordered.Returns3The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.242Library§7.12.14.6WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.13 Nonlocal jumps <setjmp.h>1The header <setjmp.h> defines the macro setjmp, and declares one function andone type, for bypassing the normal function call and return discipline.216)2The type declared isjmp_bufwhich is an array type suitable for holding the information needed to restore a callingenvironment.

The environment of a call to the setjmp macro consists of informationsufficient for a call to the longjmp function to return execution to the correct block andinvocation of that block, were it called recursively. It does not include the state of thefloating-point status flags, of open files, or of any other component of the abstractmachine.3It is unspecified whether setjmp is a macro or an identifier declared with externallinkage. If a macro definition is suppressed in order to access an actual function, or aprogram defines an external identifier with the name setjmp, the behavior is undefined.7.13.1 Save calling environment7.13.1.1 The setjmp macroSynopsis1#include <setjmp.h>int setjmp(jmp_buf env);Description2The setjmp macro saves its calling environment in its jmp_buf argument for later useby the longjmp function.Returns3If the return is from a direct invocation, the setjmp macro returns the value zero.

If thereturn is from a call to the longjmp function, the setjmp macro returns a nonzerovalue.Environmental limits4An invocation of the setjmp macro shall appear only in one of the following contexts:— the entire controlling expression of a selection or iteration statement;— one operand of a relational or equality operator with the other operand an integerconstant expression, with the resulting expression being the entire controlling216) These functions are useful for dealing with unusual conditions encountered in a low-level function ofa program.§7.13.1.1Library243ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256expression of a selection or iteration statement;— the operand of a unary ! operator with the resulting expression being the entirecontrolling expression of a selection or iteration statement; or— the entire expression of an expression statement (possibly cast to void).5If the invocation appears in any other context, the behavior is undefined.7.13.2 Restore calling environment7.13.2.1 The longjmp functionSynopsis1#include <setjmp.h>void longjmp(jmp_buf env, int val);Description2The longjmp function restores the environment saved by the most recent invocation ofthe setjmp macro in the same invocation of the program with the correspondingjmp_buf argument.

If there has been no such invocation, or if the function containingthe invocation of the setjmp macro has terminated execution217) in the interim, or if theinvocation of the setjmp macro was within the scope of an identifier with variablymodified type and execution has left that scope in the interim, the behavior is undefined.3All accessible objects have values, and all other components of the abstract machine218)have state, as of the time the longjmp function was called, except that the values ofobjects of automatic storage duration that are local to the function containing theinvocation of the corresponding setjmp macro that do not have volatile-qualified typeand have been changed between the setjmp invocation and longjmp call areindeterminate.Returns4After longjmp is completed, program execution continues as if the correspondinginvocation of the setjmp macro had just returned the value specified by val.

Thelongjmp function cannot cause the setjmp macro to return the value 0; if val is 0,the setjmp macro returns the value 1.5EXAMPLE The longjmp function that returns control back to the point of the setjmp invocationmight cause memory associated with a variable length array object to be squandered.217) For example, by executing a return statement or because another longjmp call has caused atransfer to a setjmp invocation in a function earlier in the set of nested calls.218) This includes, but is not limited to, the floating-point status flags and the state of open files.244Library§7.13.2.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3#include <setjmp.h>jmp_buf buf;void g(int n);void h(int n);int n = 6;void f(void){int x[n];setjmp(buf);g(n);}void g(int n){int a[n];h(n);}void h(int n){int b[n];longjmp(buf, 2);}§7.13.2.1// valid: f is not terminated// a may remain allocated// b may remain allocated// might cause memory lossLibrary245ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.14 Signal handling <signal.h>1The header <signal.h> declares a type and two functions and defines several macros,for handling various signals (conditions that may be reported during program execution).2The type defined issig_atomic_twhich is the (possibly volatile-qualified) integer type of an object that can be accessed asan atomic entity, even in the presence of asynchronous interrupts.3The macros defined areSIG_DFLSIG_ERRSIG_IGNwhich expand to constant expressions with distinct values that have type compatible withthe second argument to, and the return value of, the signal function, and whose valuescompare unequal to the address of any declarable function; and the following, whichexpand to positive integer constant expressions with type int and distinct values that arethe signal numbers, each corresponding to the specified condition:SIGABRT abnormal termination, such as is initiated by the abort functionSIGFPEan erroneous arithmetic operation, such as zero divide or an operationresulting in overflowSIGILLdetection of an invalid function image, such as an invalid instructionSIGINTreceipt of an interactive attention signalSIGSEGV an invalid access to storageSIGTERM a termination request sent to the program4An implementation need not generate any of these signals, except as a result of explicitcalls to the raise function.

Additional signals and pointers to undeclarable functions,with macro definitions beginning, respectively, with the letters SIG and an uppercaseletter or with SIG_ and an uppercase letter,219) may also be specified by theimplementation. The complete set of signals, their semantics, and their default handlingis implementation-defined; all signal numbers shall be positive.219) See ‘‘future library directions’’ (7.26.9). The names of the signal numbers reflect the following terms(respectively): abort, floating-point exception, illegal instruction, interrupt, segmentation violation,and termination.246Library§7.14WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.14.1 Specify signal handling7.14.1.1 The signal functionSynopsis1#include <signal.h>void (*signal(int sig, void (*func)(int)))(int);Description2The signal function chooses one of three ways in which receipt of the signal numbersig is to be subsequently handled.

Характеристики

Тип файла
PDF-файл
Размер
3,61 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее