.TH PGAEncodeRealAsGrayCode 1 "05/01/95" " " "PGAPack" .SH NAME PGAEncodeRealAsGrayCode \- encodes a real value as a binary reflected Gray code sequence .SH INPUT PARAMETERS .PD 0 .TP ctx - context variable .PD 0 .TP p - string index .PD 0 .TP pop - symbolic constant of the population the string is in .PD 0 .TP start - starting bit position in p to encode val in .PD 0 .TP end - ending bit position in p to encode val in .PD 0 .TP low - lower bound of the interval the val is defined on .PD 0 .TP high - lower bound of the interval the val is defined on .PD 0 .TP val - the real number to be represented as a binary string .PD 1 .SH OUTPUT PARAMETERS .PD 0 .TP side -effect. .PD 1 .SH SYNOPSIS .nf #include "pgapack.h" void PGAEncodeRealAsGrayCode(ctx, p, pop, start, end, low, high, val) PGAContext *ctx int p int pop int start int end double low double high double val .fi .SH LOCATION evaluate.c .SH EXAMPLE .nf Encode 3.14 from the interval [0,10] in 30 bits in bit positions 0--29 in string p in population PGA_NEWPOP as a binary reflected Gray code sequence. PGAContext *ctx; int p; : PGAEncodeRealAsGrayCode(ctx, p, PGA_NEWPOP, 0, 29, 0.0, 10.0, 3.14); .fi