Charles Randall meets two people who change his life while he is on leave from fighting in World War I: a patent lawyer for whom he designs an improved flare and the seductive wife of a fellow soldier. He ends up creating yet another invention (a pea sorter) with the former and marries the latter (after her husband is killed in action). His life takes yet another dramatic turn when he catches another man in bed with his wife, an encounter which leaves the other man dead and Randall on trial for manslaughter.
A recurrent motif in the novel is the consideration of how a very small change in circumstances could have resulted in a huge difference in the trajectory of Randall's life. It is what we mathematicians would call "sensitive dependence on initial conditions", and thinking about this book in the context of chaos theory would be very interesting for that reason. However, the author does not discuss this in mathematical terms and so I would not consider the book to be "mathematical fiction" for that reason.
Instead, I am listing this novel on my database of works of mathematical fiction for two reasons:
 As we learn these two passages, Randall views mathematics as being useful and important while his wife holds the opposite opinion:
(quoted from Randall and the River of Time)
It was news to her
that mathematics was a vitally important adjunct to science, for
to her mathematics was a rather dreary memory of schooldays
where A did a piece of work in four days, and B did it in fire
days, and where to satisfy her teacher she had to discover what
X amounted to in a string of arbitrary symbols about which she
knew almost nothing and cared not at all. She might have
classed an interest in mathematics with an interest in postage
stamps or white mice (two other subjects which did not stir her
emotions in the least), if it had not been for the fact that this
nicelooking young man before her showed such undoubted
keenness about it and at the same time was obviously no crank.

(quoted from Randall and the River of Time)
Randall drank tea to gain time. It would be no use telling her
exactly what he was thinking about. The word
"adiabatic" meant
nothing to her at all. The differential and the integral calculus
were to her things of entirely no use. Randall once, with unwonted eloquence, had tried to explain to her how the calculus
had made man master of the universe he lived in, and how its
discovery had been more important than that of gunpowder,
and he had been hurt as well as surprised at her unbelief. Muriel
was quite prepared to accept that in this ridiculous manmade
world it might be necessary to juggle with t's and y's to brain a science degree, but she could not conceive of the t's
and y's having any real importance or even any intrinsic interest. A man might as well have to learn how to keep six balls
in the air at oncefor that matter it was a way of earning a
living, too. It was no use talking about this morning's lecture to
Muriel; but luckily there was something else he could talk
about.

 Randall is the son of a mathematics teacher, and was teased about this by his classmates as a boy. Although he is described as a "science student" who wants to be a "physicist", Randall talks and thinks about math all of the time, and he represents two different mathematician stereotypes. On the one hand, he is shown to be naive. The reader would know this simply from
his interactions with other people. But, I suspect the author considered his nerdy interest in math and his naiveté not to be two independent traits, but rather linked in a way that would make each trait more believable to the reader because they came together. In addition, he is the sort of fictional character for whom mathematics is a way to hide or escape from reality, as illustrated in this excerpt:
(quoted from Randall and the River of Time)
But luckily he found an alternative; his father had brought
him his physics textbooks and at a fortunate moment he opened
one and, piqued when he found his eye running over the
printed arguments without his mind reacting to them at all, he
set himself seriously to pick up the threads. He was standing
when he began; soon he was sitting down, and then he had books
and notebooks open before him, his elbows on the table
and his forehead resting on his hands, quite lost to his surroundings
as he followed along the tortuous mathematical paths of
scientific deduction. "The
specific heat per unit mass must
then vary as 1/p^(r1)." Was he sure that it must? He had better
go back through the argument again. There was no need to
withdraw into a world of his own making; he could withdraw
into the world of mathematics: brightly and coldly lit, armored
against the exteriorlike the turret of a battleship, and in the
same way full of purposeful and functional apparatus. There he
could be oblivious, most of the time, of the black cloud of the
approaching trial extending up from the horizon until it covered
the whole sky.

Although it is not directly related to mathematics, I think it is worth noting that the character of his wife, Muriel, comes off very badly. She is not only ignorant and illogical, but unethical. Of course, such people exist and one cannot really complain if one character in a book is that way. But in the year 2022 when I am writing this, it comes across as regrettably misogynistic, as if it were saying that men are all wise and good except for when they are led astray by the opposite sex. For this reason, this novel  which was apparently well received in its time and whose author is more famous for his "Hornblower" saga  has not aged well.
I am grateful to Simon Brown of the Deviot Institute for bringing this work to my attention by forwarding to me the listing of "mathematical literature" that John S. Lew published in 1992. Lew's list included this along with a few others I had not previously heard about. Contributed by
Tom Lindstrøm
C.S. Forester was one of the literary heros of my youth, and I read everything by him I could get my hands on, including "Randall and the River of Time" (for some reason, the local library in my small Norwegian hometown had a copy). As this is more than fifty years ago, I don’t have much to add to Alex’s resumé, but I remember finding the book a little odd (too idea driven?) and not totally successful, even for an avid fan.
Still, it might be worth mentioning that Forester in general seems to have had a very positive attitude to mathematics. He often makes a point of the mathematical skills of his best known hero, the British navy officer Horatio Hornblower. As a seasick, gawky and physically unimpressive midshipman, Hornblower finally gets some positive attention when he easily solves all the navigational problems the other midshipmen find impenetrable. Later, when on half pay during the Peace of Amiens, he survives as a professional whist player, and again Forester emphasizes the mathematical aspects of the game. One gets the feeling that mathematics is used as a general symbol of intelligence, imagination, and talent throughout the series of eleven novels.
As for misogyny, I don’t really think it is typical of Forester’s work. Admittedly, there are some rather negative portraits of female characters, but there are also some very positive and/or sympathetic ones, e.g., of Hornblower’s two wives Maria and Barbara (the fictional sister of the Duke of Wellington) and of his mistress Marie de Graçay. The spinster heroine of "The African Queen" also turns out to have more guts, wits, and character than one would initially surmise (as is only to be expected from someone who has ever been played by Katherine Hepburn!).

