comp.lang.ada
 help / color / mirror / Atom feed
* Comparing version numbers
@ 2017-11-13  2:39 Victor Porton
  2017-11-13  5:15 ` J-P. Rosen
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Victor Porton @ 2017-11-13  2:39 UTC (permalink / raw)


Not sure if it is quite on-topic, because it is more about general 
programming ideas rather than about Ada. (However, a solution in Python or 
Ruby or JavaScript would more likely used regexps than Ada.)

Suppose I have two version numbers of a software. I need to check which of 
the two is greater.

Lexical order string comparison does not work:

"2.3" vs "11.4".

I could split it by "." and compare the numbers. But a component of a 
version numbers may be nonnumeric like:

"1.2beta".

What to do?

It should work for example for all Debian packages containing interpreters 
(for example, "2.7" for "python" package).

-- 
Victor Porton - http://portonvictor.org


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-11-17 14:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13  2:39 Comparing version numbers Victor Porton
2017-11-13  5:15 ` J-P. Rosen
2017-11-13  8:04   ` briot.emmanuel
2017-11-13 11:11     ` Simon Wright
2017-11-13 21:30       ` briot.emmanuel
2017-11-13  8:10 ` Dmitry A. Kazakov
2017-11-13 15:56   ` Victor Porton
2017-11-13 17:22     ` Dmitry A. Kazakov
2017-11-13 18:54       ` Victor Porton
2017-11-13 20:25         ` Dmitry A. Kazakov
2017-11-16 15:33 ` Robert Eachus
2017-11-17 14:45 ` Shark8

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox