Crunch CRiSP File Editor 6 Uživatelský manuál Strana 28

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 92
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 27
Page 28
binary | l -> r
binary && l -> r
binary || l -> r
ternary ?: r -> l
binary = += -= *= /= %= >>= <<= &= ^= |= r -> l
binary , l -> r
--------------------------------------------------------------
From K&R, p 49
In the above table, the following are not supported: ->, . (dot), (type), sizeof. Also, crunch does not support
structures, unions, pointers, or explicit dereferencing.
Crunch supports a fair amount of automatic type co-ercion. The following table lists the coercion rules when
used with the arithmetic operators only. (Type coercion is not performed for function arguments). The prefix
character is used to identify the type of the variable or expression - i = integer, f = float, l = list, s = string, a =
any type. sym is used to denote a symbol of the specified type; expr is used to denote an expression
evaluating to the specified type. (Note that these conversions are implicit -- the typecast on the right hand
side is not a supported feature, currently).
isym op= fexpr => iexpr op= (int) fexpr
fsym op= iexpr => fsym op= (double) iexpr
lsym += aexpr => append aexpr to end of lsym
fsym++ => fsym += 1.0
fsym-- => fsym -= 1.0 etc..
iexpr op fexpr => (double) iexpr op fexpr
fexpr op iexpr => fexpr op (double) iexpr
iexpr + sexpr => "iexpr + sexpr"
(string concatenation)
fexpr + sexpr => "fexpr + sexpr"
(string concatenation)
aexpr + lexpr => new list with aexpr at front
Basically, a string plus a number (or vice versa) converts the number to a string and performs string
concatenation. A list plus any type creates a new list by concatenating list and value. An integer and floating
point value when combined results in a floating point value. Using these rules, a value of one type can easily
be converted to a value in another type:
string s;
int ival;
ival = 99;
s = "Value: " + val + " brass monkeys";
/* s = "Value: 99 brass monkeys" */
ival = 1000000;
s = "Value: " + (0.0 + ival) + " big macs";
/* s = "Value: 1e+06 big macs" */
When converting floating point numbers to strings, the "%g" printf format specifier is used.
{button See Also, ALink(crunch,,,)}
Loop constructs: for, while, do
There are three main looping constructs, the for loop, the while, and the do loop. The for loop is a
generalised looping mechanism supporting the following syntax:
for ( init-expr ; while-expr ; post-expr )
statement
Zobrazit stránku 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 91 92

Komentáře k této Příručce

Žádné komentáře

ProForm Fitness, gimnastyka i trening siłowy podręczniki użytkownika

Zaczynanie od C

Kliknij na poniższy alfabet, aby przejść do pełnej listy modeli zaczynających się od tej litery

Modele Rodzaj dokumentu
C 840
Instrukcja Użytkownika   ProForm C 840 User`s manual, 34 strony
C55 PFEX35430
Instrukcja Użytkownika   ProForm C55 PFEX35430 User`s manual, 24 strony
CardioCross Trainer 831.285371
Instrukcja Użytkownika   ProForm CardioCross Trainer 831.285371 User`s manual, 16 strony
CardioCross Trainer PFEL2605.0
Instrukcja Użytkownika   ProForm CardioCross Trainer PFEL2605.0 User`s manual, 16 strony
CardioCross Trainer PFEL29222
Instrukcja Użytkownika   ProForm CardioCross Trainer PFEL29222 User`s manual, 16 strony
CardioCross Trainer PFEL39032
Instrukcja Użytkownika   ProForm CardioCross Trainer PFEL39032 User`s manual, 24 strony
CardioCrossTrainer 820
Instrukcja Użytkownika   ProForm CardioCrossTrainer 820 User`s manual, 24 strony
CROSSTRAINER
Instrukcja Użytkownika   ProForm CROSSTRAINER User`s manual, 24 strony
CrossTrainer PFEX39930
Instrukcja Użytkownika   ProForm CrossTrainer PFEX39930 User`s manual [en] , 24 strony
Instrukcja Użytkownika   ProForm CrossTrainer PFEX39930 User`s manual, 24 strony
CROSSWALK DUAL
Instrukcja Właściciela   ProForm CROSSWALK DUAL Owner`s manual [en] , 16 strony
CS9e
Instrukcja Użytkownika   ProForm CS9e User's Manual, 34 strony