Todd, who had been teaching at King's College London before the outbreak of war, was at first posted to Portsmouth, where he was set to work to find a way of reducing the innate magnetism of warships, and thus prevent them from triggering German mines. It was, he later pointed out, a thoroughly unsuitable role for a theoretical mathematician, especially when he noticed that physicists and applied mathematicians were being used to produce routine calculations.

He managed to persude the Admiralty to restructure the duties, so that theoretical scientists dealt with the pure mathematics and physicists worked on practical applications.

But his own major contribution to mathematics during the war years was entirely practical. Towards the end of the war, the British authorities had captured a man thought to be an aerodynamics scientist, and Todd's wife Olga was brought in to interrogate him. It soon became apparent that he knew nothing about aerodynamics, but was a mathematician. He disclosed that the Germans had created a secret group of mathematicians, many of them prisoners of war, working in the Black Forest. Todd and several colleagues, including the cosmologist Fred Hoyle, set out to find the centre.

"We were put by the Navy in a crazy uniform," he recalled, "and we went to Mainz, I think, because they had quarters there. And Fred Hoyle got so sick that we had to send him home." They eventually found a hunting lodge in the French zone, and discovered that, as well as the mathematicians, it contained the entire mathematical library of the University of Freiburg.

Todd pinned a notice on the door declaring the lodge the property of the Navy, but the next morning a party of Moroccan troops attempted to commandeer the building. Donning his uniform and gun, Todd managed, in haphazard French, to send them on their way. "They would have burnt the books," he explained. "There's just no doubt about that."

The Mathematisches Forschungsinstitut, as the centre later became, survived, and continues to host conferences on diverse topics in mathematics at Oberwolfach. Todd jokingly declared the incident to have been his greatest contribution to mathematics.

John Todd was born at Carnacally, Co Down, on May 16 1911. His parents were elementary school teachers who had conducted their courtship in Esperanto. Todd's family were Protestants, but were not much affected by the Troubles during the move towards independence and the civil war, except that John remembered that his popgun had to be hidden in a yew tree to prevent the police from confiscating it. His father, who also wrote a chess column for the local paper, moved to Belfast to teach, and John attended his primary school, and then Methodist College, before going on to Queen's University in the city, where he studied under AC Dixon.

From there he won an exhibition to St John's College, Cambridge, in 1931. Because he had no Latin, he could not be enrolled for an undergraduate degree, but instead became a graduate student, though he never took a degree. His supervisor JE Littlewood, who did not approve of doctoral degrees, declared that, since they existed only in order to secure a job, he would write a postcard instead.

Thus armed, Todd returned to teach at Belfast under Dixon and then JG Semple and, four years later, moved with the latter to King's College London. In his first term there the head of department became ill, and Todd was deputed to teach his class. "It was not my subject - it was group theory," he recalled. "But I was interested in the axiomatics when I gave my course, and I suddenly found a problem which should have been solved, you see, and had not been. And I could find nobody to help me. And that's how I met my wife. She was already in another college, Westfield College... So I met her there. And somehow or other, we got married."

Todd was shunted around during the war, spending time in Belfast, Oxford and London as well as Portsmouth, before his trip to Germany. With the arrival of peace, he became involved in efforts to set up a National Mathematical Laboratory and returned to teaching at London, concentrating on numerical analysis for the first time. The plans for a maths lab became bogged down in politics, but the Americans were attempting a similar project at the same time and Todd and his wife were invited to go to help set up the National Applied Mathematics Laboratory.

After a brief spell in Washington and then at Princeton, when Todd managed to interest John von Neumann in computers, he and his wife moved to UCLA. They returned for a year to King's but, offered work in Washington, Todd, who suffered from asthma, thought that the climate might be more agreeable there. The pair returned to America, and became citizens soon after.

They spent 10 years in Washington, where it was compulsory to be drunk every weekend, but where Senator McCarthy's influence made life uncomfortable for some of Todd's colleagues.

Budgetary pressure on the Bureau of Standards, for which Todd worked, also made things difficult and eventually, in 1957, he and his wife took up posts at the California Institute of Technology (usually just known as Caltech) at Pasedena, where they remained for the rest of their careers.

Todd had been working with some of the first large computers in Washington and at Caltech began to develop courses in numerical analysis and computing which laid the foundation for many of the basic principles of computing science. He also collaborated extensively with his wife - who had been the first woman to receive a teaching position at Caltech and, in 1971, the first to become a full professor - on papers in her specialisation, linear algebra, a field in which he made a number of important contributions. In May 2001 a conference to mark Todd's 90th birthday was held at Caltech.

Jack Todd died on June 21. He married the matrix and number theorist Olga Taussky on the day of the Munich Agreement - "when Mr Chamberlain claimed 'Peace in our time' and all that," said Todd. "That was '38. Then the war started." She died in 1995.

Last Updated: 2:24am BST 05/07/2007 © The Telegraph