CbmRoot
Loading...
Searching...
No Matches
CbmTofDetectorId.cxx
Go to the documentation of this file.
1/* Copyright (C) 2013 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmTofDetectorId source file -----
7// ----- Created 20/11/12 by F. Uhlig -----
8// -------------------------------------------------------------------------
9
10
11#include "CbmTofDetectorId.h"
12
18//char* CbmTofDetectorId::itoa(int value, char* result, int base) {
19// // check that the base if valid
20// if (base < 2 || base > 36) { *result = '\0'; return result; }
21//
22// char* ptr = result, *ptr1 = result, tmp_char;
23// int tmp_value;
24//
25// do {
26// tmp_value = value;
27// value /= base;
28// *ptr++ = "zyxwvutsrqponmlkjihgfedcba9876543210123456789abcdefghijklmnopqrstuvwxyz" [35 + (tmp_value - value * base)];
29// } while ( value );
30//
31// // Apply negative sign
32// if (tmp_value < 0) *ptr++ = '-';
33// *ptr-- = '\0';
34// while(ptr1 < ptr) {
35// tmp_char = *ptr;
36// *ptr--= *ptr1;
37// *ptr1++ = tmp_char;
38// }
39// return result;
40//}