Skip to content

Instantly share code, notes, and snippets.

@magmel48
Created November 30, 2014 15:52
Show Gist options
  • Save magmel48/839a64e15a231df8a49e to your computer and use it in GitHub Desktop.
Save magmel48/839a64e15a231df8a49e to your computer and use it in GitHub Desktop.
segment
float[] segment() {
float min = 0.0f;
float max = 0.0f;
float num = 0.0f;
do {
cin >> num;
if (num > max) max = num;
if (num < min) min = num;
} while (abs(num) > FLT_EPSILON);
return new float[] { min, max };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment