summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-02-07 16:17:54 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-02-07 16:17:54 +0100
commit880fc26857d068789119ac79acf58b57c7d94b9e (patch)
treeba7b56266a24d605b3040570102d1d26b919ea8e
parent3cbbe7be2cced7aec9c79e81d6259adaa9772208 (diff)
Fix clang compiler warning
Warning was: "implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648" Not a big deal in this context, but anyway.
-rw-r--r--examples/tree-custom-sort.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/tree-custom-sort.cxx b/examples/tree-custom-sort.cxx
index 36a662560..c0e0b16c7 100644
--- a/examples/tree-custom-sort.cxx
+++ b/examples/tree-custom-sort.cxx
@@ -59,7 +59,7 @@ int main(int argc, char *argv[]) {
// Add 200 random numbers to the tree
char word[50];
for ( int t=0; t<200; t++ ) {
- sprintf(word, "%ld", long((float(rand()) / RAND_MAX) * 1000000));
+ sprintf(word, "%ld", long((double(rand()) / double(RAND_MAX)) * 1000000));
G_tree->add(word);
}